home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume17 / zoo2 / part07 < prev    next >
Encoding:
Internet Message Format  |  1989-02-01  |  40.6 KB

  1. Subject:  v17i070:  Zoo archive program, Part07/10
  2. Newsgroups: comp.sources.unix
  3. Approved: rsalz@uunet.UU.NET
  4.  
  5. Submitted-by: Rahul Dhesi <bsu-cs!dhesi@iuvax.cs.indiana.edu>
  6. Posting-number: Volume 17, Issue 70
  7. Archive-name: zoo2/part07
  8.  
  9. #! /bin/sh
  10. # This is a shell archive.  Remove anything before this line, then unpack
  11. # it by saving it into a file and typing "sh file".  To overwrite existing
  12. # files, type "sh file -c".  You can also feed this as standard input via
  13. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  14. # will see the following message at the end:
  15. #        "End of archive 7 (of 10)."
  16. # Wrapped by rsalz@papaya.bbn.com on Thu Feb  2 18:04:03 1989
  17. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  18. if test -f 'vmsbugs.doc' -a "${1}" != "-c" ; then 
  19.   echo shar: Will not clobber existing file \"'vmsbugs.doc'\"
  20. else
  21. echo shar: Extracting \"'vmsbugs.doc'\" \(19668 characters\)
  22. sed "s/^X//" >'vmsbugs.doc' <<'END_OF_FILE'
  23. X
  24. X
  25. X                           Zoo 2.0 on VAX/VMS
  26. X                                   by
  27. X                              Rahul Dhesi
  28. X
  29. X
  30. XThe zoo archiver is used to create and maintain archives containing mul-
  31. Xtiple files that may be stored in compressed format.  Consult the zoo
  32. Xmanual for more details.  This document describes those features of
  33. XVAX/VMS zoo that are specific to the VAX/VMS implementation.
  34. X
  35. X
  36. X                              INSTALLATION
  37. X
  38. XThe file "descrip.mms" is a makefile suitable for use with DEC's imple-
  39. Xmentation of make, called MMS.  To avoid any confusion, delete the file
  40. Xcalled "makefile" as that is not for VAX/VMS systems and it might con-
  41. Xfuse MMS.  With all source files in the current directory, simply type
  42. XMMS and wait while all files get compiled and linked.  (If your system
  43. Xdoes not have MMS, you will have to compile each C source file by hand,
  44. Xproviding the C compiler with the necessary defines on the command line.
  45. XIf you are not familiar with the format of makefiles, find somebody who
  46. Xis, and do what MMS would have done by following what is in
  47. X"descrip.mms".)  The result should be the executable program "zoo.exe".
  48. X
  49. XThen give the command "mms fiz" to build "fiz.exe".
  50. X
  51. XOptionally, the command "mms zoobig.exe" will create a version of the
  52. Xexecutable that is linked without the shareable library.  This may be
  53. Xmore portable if you intend to transfer it to an VMS system that does
  54. Xnot have its own C compiler.  But "zoobig.exe" will be about twice the
  55. Xsize of "zoo.exe".
  56. X
  57. XAlso compile the program "bilf.c".  This is done manually and not from
  58. Xthe makefile.  Compile with "cc bilf.c" and link with "link bilf,
  59. Xoptions/opt".
  60. X
  61. XTo run zoo, bilf, and fiz, you will need to set up symbols by giving
  62. Xcommands similar to the following, either by typing them at the system
  63. Xprompt or by putting them in your "login.com" file.
  64. X
  65. X     $ zoo  :== $ user$disk:[userdir]zoo.exe
  66. X     $ fiz  :== $ user$disk:[userfir]fiz.exe
  67. X     $ bilf :== $ user$disk:[userdir]bilf.exe
  68. X
  69. XIn place of "user$disk" use the name of the device on which
  70. Xyour login directory is located, and instead of "userdir" use
  71. Xthe name of the directory in which you have placed the executable
  72. Xprograms "zoo.exe" and "fiz.exe".
  73. X
  74. X
  75. X                          WARNING -- VMS BUGS
  76. X
  77. XVAX/VMS peculiarities cause unusual bahavior.
  78. X
  79. X   - VMS C does not preserve uppercase characters in a command line.  To
  80. X     specify a command containing an uppercase character, enclose the
  81. X     command in double quotes.  For example, the command
  82. X
  83. X          zoo aM stuff *
  84. X
  85. X     will not work under VMS.  To make this command work under VMS, use
  86. X     double quotes like this:
  87. X
  88. X          zoo "aM" stuff *
  89. X
  90. X   - For most text files that are not in stream-LF format, VMS returns
  91. X     an incorrect file size to zoo.  This will be evident if you use the
  92. X     "f" modifier to tell zoo to archive files without compression.
  93. X     Files that were in stream-LF format will be stored with the correct
  94. X     size;  other text files will be stored with an incorrect value for
  95. X     the original size of the file.
  96. X
  97. X     When such files are extracted, however, they are extracted in
  98. X     stream-LF format, which is the only file format that VMS seems to
  99. X     handle correctly.  Thus, so far as I can determine, no file con-
  100. X     tents are actually lost, and the only evidence of the problem is
  101. X     that in archive listings, files stored without compression may
  102. X     still appear to be compressed by about 1 to 5 percent, or occasion-
  103. X     ally by some meaningless value.
  104. X
  105. X   - I have not yet found a way of making zoo for VMS restore file
  106. X     timestamps at extraction time.  The standard utime() function seems
  107. X     to be entirely missing in VMS C.  One of these days I will have to
  108. X     figure out RMS extended attribute blocks.
  109. X
  110. X   - VAX/VMS uses many different types of file structures.  Zoo creates
  111. X     archives in stream-LF format, and all archives used by zoo in any
  112. X     way must be in this format.  It is dangerous to use zoo on an
  113. X     archive that is in any other format, because it may permanently
  114. X     corrupt the archive contents.  Thus, if you have uploaded an
  115. X     archive to a VMS system using Kermit, do not try to manipulate it
  116. X     with zoo until you have converted it to stream-LF format.  File
  117. X     conversion instructions are given later in this document.
  118. X
  119. X   - The VAX/VMS batch system causes the C statement
  120. X
  121. X          fflush(stdout);
  122. X
  123. X     to become equivalent to:
  124. X
  125. X          printf("\n");
  126. X
  127. X     The result is that if files are added to a zoo archive from a batch
  128. X     run, the batch log will look very strange and contain spurious new-
  129. X     lines.
  130. X
  131. X"Again," says my VMS C manual, "VAX C adds functionality".  The internal
  132. Xworking of zoo has been designed to evade this added functionality.  I
  133. Xbelieve that text files and executable files are currently correctly
  134. Xhandled by zoo.  But each version of VMS C seems to have its own special
  135. Xfeatures, and it is hard to say how future changes in the VMS C compiler
  136. Xwill affect the zoo archiver.  I believe I will be able to follow these
  137. Xchanges, and to continue to work around past, present, and future added
  138. Xfunctionality in VMS C, but don't bet your life on it.
  139. X
  140. X
  141. X                        ARCHIVING SELECTED FILES
  142. X
  143. XZoo can read filenames from standard input.  This allows you to use an
  144. Xexternal program to generate a list of files to be archived.  When this
  145. Xlist is fed to zoo, it will archive only the selected files.
  146. X
  147. XFor this example, assume that files are to be archived in an archive
  148. Xcalled "backups.zoo".
  149. X
  150. XTo achieve redirection of input under VAX/VMS, the following steps are
  151. Xnecessary:
  152. X
  153. X 1.  Create a file containing the filenames to be archived.  Suppose
  154. X     this file is called "names.lis".
  155. X
  156. X 2.  Redirect zoo's standard input thus:
  157. X
  158. X          $ define /user_mode SYS$INPUT names.lis
  159. X
  160. X
  161. X 3.  Invoke zoo thus:
  162. X
  163. X          $ zoo "aI" backups
  164. X
  165. X     This command line will cause zoo to read a list of filenames from
  166. X     its standard input, and archive them into "backups.zoo".  Since the
  167. X     logical name SYS$INPUT was changed to refer to the file
  168. X     "names.lis", zoo will read filenames from that file.
  169. X
  170. XA good way of creating a list of files to be archived is to use the vms
  171. X"directory" command.  Include at least the switches shown:
  172. X
  173. X     $ directory /noheading /notrailing /column=1 /output=names.lis
  174. X
  175. XThis tells VMS to produce a list of filenames, one per line, and to
  176. Xstore the resulting output in the file "names.lis".  You can also add
  177. Xadditional selection options.  For example, to select all files that
  178. Xhave been modified in the last 12 hours:
  179. X
  180. X     $ dir/nohead/notrail/col=1/out=names.lis/since=-12:00/modified
  181. X
  182. XA good way to decrease the effort is to create a symbol as follows:
  183. X
  184. X     $ select:=="dir/nohead/notrail/col=1/out=names.lis/modified/since="
  185. X
  186. XNow you can archive all *.c files modified in the last 60 minutes by
  187. Xgiving the following commands:
  188. X
  189. X     $ select -1:00:00 *.c
  190. X     $ define/user sys$input names.lis
  191. X     $ zoo "aI" backups
  192. X
  193. X
  194. X                       FILE TRANSFERS WITH KERMIT
  195. X
  196. XZoo archives can be uploaded to a VAX/VMS system and downloaded from it
  197. Xusing Kermit.  Due to VMS limitations, some file conversions must be
  198. Xdone to avoid a corrupted zoo archive.
  199. X
  200. XZoo always expects zoo archives to be in stream-LF format.  However, the
  201. Xstandard VAX/VMS Kermit does not create stream-LF files, and treats them
  202. Xas text files when it reads them, resulting in corrupted downloads.
  203. XThus you must handle Kermit transfers with care. The following discus-
  204. Xsions refers solely to the standard Kermit-32, which I believe is from
  205. Xthe Stevens Institute of Technology.  If the following instructions are
  206. Xcarefully followed, you should be able to transfer zoo archives between
  207. Xa VAX/VMS system and a microcomputer running Kermit.
  208. X
  209. XKERMIT UPLOADS:  To transfer a zoo archive from a microcomputer to a
  210. XVAX/VMS system, do the following.
  211. X
  212. X 1.  Invoke VAX/VMS Kermit as shown below.  It will prompt you with the
  213. X     string "Kermit-32>".  Give it a command as shown to tell it to
  214. X     receive a binary file:
  215. X
  216. X          $ kermit
  217. X          Kermit-32> set file type binary
  218. X          Kermit-32> set block-check 3
  219. X          Kermit-32> receive
  220. X
  221. X     Note:  Do not use the command "set file type fixed".  In most cases
  222. X     it will not work.
  223. X
  224. X     The command to set the block-check is optional, but tells Kermit to
  225. X     use a 16-bit CRC, which is much more reliable than the default 6-
  226. X     bit CRC.  Use this command if your version of Kermit does not use a
  227. X     16-bit CRC by default.
  228. X
  229. X 2.  At this point, VAX/VMS Kermit is waiting for you to send it a file.
  230. X     Now tell your local Kermit to send the file.  On an MS-DOS system,
  231. X     using MS-Kermit, you would do this by first typing the local escape
  232. X     sequence to get to the local mode, where the prompt is "MS-
  233. X     Kermit>", then telling your local Kermit to send the zoo archive as
  234. X     a binary file.  A typical sequence of commands is:
  235. X
  236. X          (type escape sequence to get back to local mode)
  237. X          MS-Kermit> set eof noctrl-z
  238. X          MS-Kermit> send stuff.zoo
  239. X
  240. X     It is important that your local Kermit send the zoo archive as a
  241. X     binary file, not a text file.  How you do this depends on your sys-
  242. X     tem;  on MS-DOS systems it suffices to give say "set eof noctrl-z".
  243. X
  244. X 3.  Wait until the Kermit upload is complete.  Then tell your local
  245. X     Kermit to go into terminal mode (usually by giving the command CON-
  246. X     NECT), and exit from VAX/VMS Kermit with the command EXIT.  A typi-
  247. X     cal sequence is:
  248. X
  249. X          MS-Kermit> connect
  250. X          (stuff from MS-Kermit printed...)
  251. X          (hit carriage return if necessary to get the next prompt)
  252. X          Kermit-32> exit
  253. X          $
  254. X
  255. X     Now you are back at the VAX/VMS prompt.  At this point, you must
  256. X     convert the uploaded zoo archive, which is currently in binary for-
  257. X     mat, to stream-LF format so that it can be used by VAX/VMS zoo.
  258. X     You do this by using the Bilf utility, which can convert files
  259. X     between binary and stream-LF formats.  Give the command:
  260. X
  261. X          $ bilf l stuff.zoo
  262. X
  263. X 4.  After Bilf has done the conversion, you will have a new generation
  264. X     of stuff.zoo that is in stream-LF format.  Now you can manipulate
  265. X     it normally with VAX/VMS zoo.
  266. X
  267. XDON'T TRY TO USE ZOO TO MANIPULATE AN UPLOADED ARCHIVE WITHOUT PERFORM-
  268. XING THE CONVERSION TO STREAM-LF FORMAT, ELSE YOU MAY PERMANENTLY DESTROY
  269. XARCHIVE CONTENTS.
  270. X
  271. XKERMIT DOWNLOADS:  Before downloading a zoo archive from VAX/VMS to a
  272. Xmicrocomputer, you must convert it to binary format.    Then use VMS
  273. XKermit normally.  A sample sequence is shown.
  274. X
  275. X 1.  Convert the zoo archive to binary format.
  276. X
  277. X          $ bilf b stuff.zoo
  278. X
  279. X 2.  Invoke VMS Kermit and tell it to send the file.
  280. X
  281. X          $ kermit
  282. X          Kermit-32> set block-check 3
  283. X          Kermit-32> send stuff.zoo
  284. X
  285. X 3.  Get back to your local Kermit and tell it to receive a binary file.
  286. X
  287. X          (type escape sequence to get into local mode)
  288. X          MS-Kermit> set eof noctrl-z
  289. X          MS-Kermit> receive
  290. X          (transfer takes place)
  291. X
  292. X
  293. X                         FILE TRANSFER SUMMARY
  294. X
  295. XHere are pictorial summaries of the steps involved in performing file
  296. Xtransfers of zoo archives using Kermit.
  297. X
  298. X======================================================================
  299. X
  300. XDOWNLOADS:
  301. X                                           files on a VMS
  302. X                                         system to be archived
  303. X                                               using zoo
  304. X                                                    |
  305. X                                   archive created  |
  306. X                                   using zoo.exe    |
  307. X                                   or zoobig.exe    |
  308. X                                   on a VMS system  |
  309. X                                                    v
  310. X
  311. Xzoo archive on VMS      bilf b           zoo archive on VMS, in
  312. Xin fixed-length     <----------------    in stream-LF format
  313. Xbinary format
  314. X      |
  315. X      |
  316. X      | archive transferred
  317. X      | from VMS to microcomputer
  318. X      | using Kermit; receiving
  319. X      | Kermit must be told this
  320. X      | is a binary file; sending
  321. X      | Kermit may need to be told too
  322. X      |
  323. X      v
  324. Xzoo archive
  325. Xon microcomputer
  326. Xsystem
  327. X
  328. X======================================================================
  329. X
  330. XUPLOADS:
  331. X
  332. Xzoo archive
  333. Xon microcomputer
  334. Xsystem
  335. X    |
  336. X    |
  337. X    | archive uploaded to VMS using Kermit;
  338. X    | receiving Kermit on VMS must be given
  339. X    | command "set file type binary"
  340. X    | (NOTE:  "set file type fixed" will
  341. X    | usually not work);  sending Kermit
  342. X    | must be told this is a binary file
  343. X    |
  344. X    v
  345. Xzoo archive on VMS,       bilf l         zoo archive on VMS, in
  346. Xin variable-length    ---------------->    in stream-LF format
  347. Xbinary format                                      |
  348. X                                                   | extract
  349. X                                                   | normally using
  350. X                                                   | zoo on VMS
  351. X                                                   |
  352. X                                                   v
  353. X                                         files extracted from zoo
  354. X                                          archive on a VMS system
  355. X
  356. X======================================================================
  357. X
  358. X
  359. X                       ENSURING ARCHIVE INTEGRITY
  360. X
  361. XAfter performing a transfer of a zoo archive using Kermit (and perform-
  362. Xing any file conversion necessary for VMS), make it a habit to immedi-
  363. Xately test the integrity of the transferred archive with the -test com-
  364. Xmand of zoo, illustrated for VMS:
  365. X
  366. X     $ zoo -test stuff
  367. X
  368. XIn addition, also get a listing of the archive contents:
  369. X
  370. X     $ zoo -list stuff
  371. X
  372. XIf neither command reports an error, it is reasonable to assume that
  373. Xarchive integrity was not harmed by the Kermit transfer.
  374. X
  375. XThe -test command tests the integrity of each stored file.  The -list
  376. Xcommand tests the integrity of the internal archive structure.  Both are
  377. Xchecked using separate cyclic redundancy codes, one for each archived
  378. Xfile, and one for each directory entry in the archived. (Actually, the
  379. X-list command ignores deleted entries, so if the archive contains any,
  380. Xuse the "ld" command instead.)
  381. X
  382. X
  383. X                               WILDCARDS
  384. X
  385. XAll implementations of zoo on all systems use the same wildcard charac-
  386. Xters:  "*" matches any sequence of zero or more characters, and "?"
  387. Xmatches any one character.
  388. X
  389. XADDING FILES:  For specifying directory names when adding files, use the
  390. Xusual VAX/VMS syntax.  Thus, to recursively archive all files in the
  391. Xcurrent directory and all its subdirectories, the command syntax is:
  392. X
  393. X     $ zoo a stuff [...]*
  394. X
  395. X The character range wildcard of the form "c-c" is also available, which
  396. X will select all files beginning with the specified character range.
  397. X For example,
  398. X
  399. X      $ zoo a stuff [...]a-d [...]x-z
  400. X
  401. X will archive all files beginning with the characters a through d, and
  402. X with the characters x through z, in the current directory and all its
  403. X subdirectories.  A side-effect of this is that during addition to
  404. X archives, dots in filenames must be explicitly matched.  Thus to add
  405. X all files with an extension of DOC, you would type:
  406. X
  407. X      $ zoo a stuff *.doc
  408. X
  409. X and "*doc" will not work.  As a special case, a trailing "*.*" in any
  410. X filename you specify can always be replaced by just a trailing "*".
  411. X The safest rule to follow when adding files is to always specify the
  412. X dot in each filename.
  413. X
  414. X EXTRACTING FILES:  During extraction, both the directory name and the
  415. X filename must be specified according to zoo syntax.  Thus you could say
  416. X
  417. X      $ zoo x stuff [*xyz*]*.doc
  418. X
  419. X to extract all archived files with filenames that match "*.doc" and
  420. X that contain the string "xyz" in the directory name.  Note that VMS
  421. X syntax for selecting directories won't work here:
  422. X
  423. X      $ zoo x stuff [...]*.doc        ! won't work for extraction
  424. X
  425. X If you do not specify the directory name at all, zoo will only perform
  426. X the match against filenames;  thus
  427. X
  428. X      $ zoo x stuff *.doc
  429. X
  430. X will extract all files matching *.doc regardless of the directory name.
  431. X
  432. X Also note that if you specify extraction of "*.*", as in
  433. X
  434. X      $ zoo x stuff *.*
  435. X
  436. X it will result in the extraction of files whose filename contains at
  437. X least one dot.  Similarly, the command
  438. X
  439. X      $ zoo x stuff *_*
  440. X
  441. X will select all filename containing at least one underscore.
  442. X
  443. X To extract all files, specify no filename, e.g.
  444. X
  445. X      $ zoo x stuff
  446. X
  447. X or use "*" rather than "*.*".
  448. X
  449. X SAFEST RULE OF THUMB:  WHEN SELECTING FILES ON DISK, SPECIFY THE DOT IN
  450. X EACH FILENAME;  WHEN SELECTING FILES INSIDE A ZOO ARCHIVE, SPECIFY A
  451. X DOT ONLY IF YOU NEED ONE.  But to select all files, you can always just
  452. X use "*".
  453. X
  454. X
  455. X                            FILE GENERATIONS
  456. X
  457. X When a file is added to an archive, the generation number (if any) that
  458. X it is given in the archive is not related to the generation number it
  459. X had in the VAX/VMS filesystem.  At extraction time a new version is
  460. X always created for an extracted file.  The overwrite option ("O") does
  461. X not cause overwriting, but simply suppresses the warning message that
  462. X zoo normally gives when it finds that a file about to be extracted
  463. X already exists.
  464. X
  465. X
  466. X                             FILE STRUCTURES
  467. X
  468. X At extraction time, zoo preserves all data bytes in binary files, and
  469. X stores all text files as lines of text terminated with linefeeds. The
  470. X internal file structure maintained by DEC's RMS is not currently
  471. X preserved.  (Support for this is planned for the distant future.)
  472. X Thus, the following two types of files can be safely archived and
  473. X restored:
  474. X
  475. X    - All text files are extracted in stream-LF format.  Most VMS utili-
  476. X      ties that accept text files will accept such files.  The EDT edi-
  477. X      tor may complain, but will still work.
  478. X
  479. X    - VMS executable files, when stored and then extracted, are
  480. X      extracted in stream-LF format.  Such files can be restored to
  481. X      their original state using Bilf with the "b" option.  (However,
  482. X      current versions of VAX/VMS seem to be able to load and execute
  483. X      stream-LF files, so conversion may not be necessary.)
  484. X
  485. X HANDLING VMS EXECUTABLE FILES.  You can archive an executable program
  486. X called "xyz.exe":
  487. X
  488. X      $ zoo a stuff xyz.exe
  489. X      $ delete xyz.exe;*
  490. X
  491. X Now the only copy of xyz.exe is in the archive "stuff.zoo".  Extract
  492. X it:
  493. X
  494. X      $ zoo x stuff xyz.exe
  495. X
  496. X The extracted copy of "xyz.exe" is in stream-LF format and VMS may or
  497. X may not execute it.  Now we convert it back to fixed-length record for-
  498. X mat thus:
  499. X
  500. X      $ bilf b xyz.exe
  501. X      $ purge xyz.exe
  502. X
  503. X Now "xyz.exe" has been converted to binary format and can be executed.
  504. X It should be identical to the original copy of "xyz.exe" that was
  505. X archived.
  506. X
  507. X TEXT FILES FROM OTHER SYSTEMS.  A text file archived on a different
  508. X computer system will use either linefeeds, or carriage returns plus
  509. X linefeeds, as line terminators.  Text files with linfeeds only can be
  510. X be extracted and used exactly as if they had been archived on a VAX/VMS
  511. X system.  Text files containing carriage returns plus linefeeds will,
  512. X when extracted, contain a spurious carriage return at the end of each
  513. X line.  This extra carriage return can be removed using EDT's "substi-
  514. X tute" command while in screen mode.  Simply replace all carriage returns
  515. X with nothing.  The VMS C compiler currently appears to accept trailing
  516. X carriage returns in files without any trouble.
  517. X
  518. X Text files trasnferred from MS-DOS or CP/M or similar systems may con-
  519. X tain a trailing control Z character.  This may cause problems on VMS
  520. X and should be edited out with a text editor.
  521. X
  522. X                                     -- Rahul Dhesi 1988/02/04
  523. END_OF_FILE
  524. if test 19668 -ne `wc -c <'vmsbugs.doc'`; then
  525.     echo shar: \"'vmsbugs.doc'\" unpacked with wrong size!
  526. fi
  527. # end of 'vmsbugs.doc'
  528. fi
  529. if test -f 'zoolist.c' -a "${1}" != "-c" ; then 
  530.   echo shar: Will not clobber existing file \"'zoolist.c'\"
  531. else
  532. echo shar: Extracting \"'zoolist.c'\" \(18889 characters\)
  533. sed "s/^X//" >'zoolist.c' <<'END_OF_FILE'
  534. X#ifndef LINT
  535. X/* @(#) zoolist.c 2.27 88/08/15 11:03:16 */
  536. Xstatic char sccsid[]="@(#) zoolist.c 2.27 88/08/15 11:03:16";
  537. X#endif /* LINT */
  538. X
  539. X/*
  540. XIf TRACE_LIST is defined, any list command may be followed
  541. Xby 'D' to show verbose information about each directory
  542. Xentry in the archive.   Do not define both TRACE_LIST and
  543. XTRACE_IO else a symbol conflict will occur and in any case
  544. Xduplicate information will be dumped.
  545. X*/
  546. X
  547. X/* #define TRACE_LIST */
  548. X
  549. X/*
  550. XCopyright (C) 1986, 1987 Rahul Dhesi -- All rights reserved
  551. X(C) Copyright 1988 Rahul Dhesi -- All rights reserved
  552. X*/
  553. X#include "options.h"
  554. X#include "portable.h"
  555. X#include "zoomem.h"  /* to get ZOOCOUNT */
  556. X
  557. X/* Lists files in archive */
  558. X#include "zoo.h"
  559. X#include "errors.i"
  560. X#include "zooio.h"
  561. X#include "various.h"
  562. X#include "zoofns.h"
  563. X
  564. X#ifdef TRACE_LIST
  565. Xvoid show_dir PARMS ((struct direntry *direntry));
  566. Xstatic int trace_list = 0;
  567. X#endif /* TRACE_LIST */
  568. X
  569. Xstatic char tot_fmt[] = "%8lu %3u%% %8lu  %4d file";
  570. Xstatic char tot_line[] =
  571. X   /* "------------  --------  ---  --------  --------- --------\n"; */
  572. X   "--------  --- --------  --------- --------\n";
  573. X
  574. Xstatic char dbl_percent[] = "Archive %s:  %s";
  575. X
  576. Xextern int quiet;                /* assumed initialized to zero */
  577. X
  578. X#ifdef LINT_ARGS
  579. Xvoid show_comment (struct direntry *, ZOOFILE, int, char *);
  580. Xint ver_too_high (struct zoo_header *);
  581. Xint needed (char *, struct direntry *, struct zoo_header *);
  582. Xvoid printtz (int);
  583. X#else
  584. Xvoid show_comment ();
  585. Xint ver_too_high ();
  586. Xint needed ();
  587. Xvoid printtz ();
  588. X#endif
  589. X
  590. Xvoid zoolist (argv, option, argc)
  591. Xchar **argv, *option;
  592. Xint argc;
  593. X{
  594. Xchar whichname[PATHSIZE];  /* which name to use */
  595. Xchar *this_zoo;            /* currently matched archive name */
  596. Xregister ZOOFILE zoo_file;
  597. Xchar *flist[ZOOCOUNT];       /* list of ptrs to input archive names */
  598. Xint fptr;                  /* will point to within list of archive names */
  599. X
  600. Xstruct direntry direntry;
  601. Xstruct zoo_header zoo_header;
  602. Xint size_factor;
  603. Xunsigned long tot_org_siz = 0L, tot_siz_now = 0L;
  604. Xint   tot_sf;
  605. Xint file_count = 0;
  606. Xint del_count = 0;                  /* number of deleted entries */
  607. Xint bad_pack;                 /* 1 if packing method is unknown */
  608. Xstatic char *month_list="000JanFebMarAprMayJunJulAugSepOctNovDec";
  609. Xstatic char dashes[] = "------------\n";
  610. Xint year, month, day, hours, min, sec;
  611. Xint list_deleted = 0;         /* list deleted files too */
  612. Xint fast = 0;                 /* fast list */
  613. Xlong fiz_ofs = 0;             /* offset where to start */
  614. Xlong dat_ofs = 0;             /* ... data offset of file data */
  615. Xint verb_list = 0;            /* if verbose listing needed */
  616. Xint show_name = 0;            /* if archive name to be included in listing */
  617. Xint show_crc = 0;                    /* if crc should be listed */
  618. Xint zoocount = 1;             /* number of archives to list */
  619. Xint biglist = 0;              /* multiarchive listing */
  620. Xint one_col = 0;                    /* one column listing requested */
  621. Xint showdir = 0;                    /* show directory name in fast listing */
  622. Xint longest;                  /* length of longest archive name */
  623. Xint talking;                        /* opposite of quiet */
  624. Xint column = 0;               /* for column printing */
  625. Xint first_ever = 1;                /* first time ever -- very special case */
  626. Xint neednl = 0;                    /* whether to print a newline */
  627. Xint need_acmt = 0;                /* show archive comment */
  628. Xint show_gen = 0;                    /* show generation count */
  629. Xint genson = 1;                    /* enable/disable generations */
  630. X#ifdef FATTR
  631. Xint show_mode = 0;                /* show file protection */
  632. X#endif
  633. Xint first_dir = 1;                /* if first direntry -- to adjust dat_ofs */
  634. X
  635. Xwhile (*option) {
  636. X   switch (*option) {
  637. X      case 'a': show_name++; break;
  638. X#ifdef TRACE_LIST
  639. X        case 'D': trace_list++; break;
  640. X#endif /* TRACE_LIST */
  641. X      case 'd': list_deleted++; break;
  642. X      case 'f': fast++; break;
  643. X        case 'g': show_gen++; break;
  644. X        case '/': showdir++; break;
  645. X        case 'A':
  646. X        case 'v': need_acmt++; break;
  647. X      case 'V': need_acmt++; /* fall through */
  648. X      case 'c': verb_list++; break;
  649. X        case 'C': show_crc++; break;
  650. X      case 'l': break;
  651. X      case 'L': biglist++; zoocount = argc; break;
  652. X#ifdef FATTR
  653. X        case 'm': show_mode++; break;
  654. X#endif
  655. X        case '1': one_col++; break;
  656. X        case '+': genson = 1; break;
  657. X        case '-': genson = 0; break;
  658. X        /* following code same as in zooext.c */
  659. X      case '@':     /* if @m,n specified, fiz_ofs = m, dat_ofs = n */
  660. X            {
  661. X                char *comma_pos;
  662. X                ++option;
  663. X                comma_pos = strchr(option, ',');
  664. X                if (comma_pos != NULL) {
  665. X                    dat_ofs = calc_ofs (comma_pos + 1);
  666. X                    *comma_pos = '\0';
  667. X                }
  668. X                fiz_ofs = calc_ofs(option); 
  669. X                goto no_more;
  670. X            }
  671. X        case 'q': quiet++; break;
  672. X      default:
  673. X         prterror ('w', option_ignored, *option);
  674. X   }
  675. X   option++;
  676. X}
  677. X
  678. Xno_more:  /* come from exit from while loop above */
  679. X
  680. Xif (fast && show_name) {      /* don't allow 'a' with 'f' */
  681. X   show_name = 0;
  682. X   prterror ('w', option_ignored, 'a');
  683. X}
  684. X
  685. Xtalking = !quiet;                    /* for convenience */
  686. X
  687. X#ifdef WILDCARD
  688. X   /* For each archive name supplied, if it is not a char range and
  689. X      does not contain a dot, append "*.zoo". */
  690. X   {
  691. X      int i;
  692. X      for (i = 0; i < argc;  i++) {
  693. X         if (strchr (nameptr (argv[i]), EXT_CH) == NULL && 
  694. X                           !match_half (nameptr (argv[0]), "?-?"))
  695. X            argv[i] = newcat (argv[i], "*.zoo");
  696. X      }
  697. X   }
  698. X#endif
  699. X
  700. Xmakelist (zoocount, argv, flist,        ZOOCOUNT-2,   (char *) NULL,".","..", &longest);
  701. X/*        ^argc     ^argv ^list_pointer ^max_no_files   ^exclude */
  702. X
  703. Xfor (fptr = 0;  (this_zoo = flist[fptr]) != NULL; fptr++) {
  704. X   int ercount;                  /* count of errors */
  705. X   int entrycount;               /* count of directory entries */
  706. X   int expl_deleted;             /* explain what D means */
  707. X   int expl_comment;             /* explain what comment means */
  708. X   int expl_ver;                 /* Explain what V means */
  709. X   int expl_star;                /* Explain what * means */
  710. X   int first_time;               /* first time through loop for an archive */
  711. X
  712. X   ercount = entrycount = del_count =
  713. X      expl_deleted = expl_comment = expl_ver = expl_star = 0;
  714. X
  715. X    if (talking)
  716. X        column = 0;                        /* if quiet, names will run together */
  717. X
  718. X   first_time = 1;
  719. X
  720. X#ifndef WILDCARD
  721. X   /* Add default extension if none supplied */
  722. X   if (strchr (nameptr (this_zoo), EXT_CH) == NULL)
  723. X      this_zoo = newcat (this_zoo, EXT_DFLT);
  724. X#endif
  725. X
  726. X   zoo_file = zooopen (this_zoo, Z_READ);
  727. X
  728. X   if (zoo_file == NOFILE) {
  729. X      prterror ('e', could_not_open, this_zoo);
  730. X      continue;
  731. X   } else if (!show_name && talking)
  732. X      printf ("\nArchive %s:\n", this_zoo);
  733. X   
  734. Xif (fiz_ofs != 0L) {                /* if offset specified, start there */
  735. X    prterror ('m', start_ofs, fiz_ofs, dat_ofs);
  736. X   zooseek (zoo_file, fiz_ofs, 0);
  737. X} else {
  738. X   if (frd_zooh (&zoo_header, zoo_file) == -1 ||
  739. X                                             zoo_header.zoo_tag != ZOO_TAG) {
  740. X      prterror ('e', dbl_percent, this_zoo, invalid_header);
  741. X      goto loop_end;
  742. X   }
  743. X#if 0
  744. X    if (talking && (!show_name || verb_list || need_acmt))
  745. X#else
  746. X    if (need_acmt && talking)
  747. X#endif
  748. X    {
  749. X        void show_acmt PARMS ((struct zoo_header *, ZOOFILE, int));
  750. X        show_acmt (&zoo_header, zoo_file, 0);        /* show archive comment */
  751. X    }
  752. X
  753. X   /* Seek to the beginning of the first directory entry */
  754. X   if (zooseek (zoo_file, zoo_header.zoo_start, 0) != 0) {
  755. X      ercount++;
  756. X      prterror ('e', dbl_percent, this_zoo, bad_directory);
  757. X      goto loop_end;
  758. X   }
  759. X   if (!show_name && ver_too_high (&zoo_header)) {
  760. X      ercount++;
  761. X      if (ercount < 2)
  762. X         prterror ('M', wrong_version, 
  763. X                                        zoo_header.major_ver, zoo_header.minor_ver);
  764. X   }
  765. X} /* end if (fiz_ofs !- 0L) */
  766. X
  767. X   /* Now we print information about each file in the archive */
  768. X   
  769. X   if (!show_name) { /* initialize for each file only if not disk catalog */
  770. X      tot_org_siz = 0L;  
  771. X      tot_siz_now = 0L;
  772. X      file_count = 0;
  773. X      del_count = 0;
  774. X   }
  775. X
  776. X   while (1) {
  777. X      if (readdir (&direntry, zoo_file, 0) == -1) {
  778. X         prterror ('F', dbl_percent, this_zoo, bad_directory);
  779. X         goto givesummary;
  780. X      }
  781. X      if (direntry.zoo_tag != ZOO_TAG) {
  782. X         long currpos, zoolength;
  783. X         prterror ('F', dbl_percent, this_zoo, invalid_header);
  784. X         if ((currpos = zootell (zoo_file)) != -1L)
  785. X            if (zooseek (zoo_file, 0L, 2) == 0)
  786. X               if ((zoolength = zootell (zoo_file)) != -1L)
  787. X                  printf (cant_process, zoolength - currpos);              
  788. X         goto givesummary;
  789. X      }
  790. X   
  791. X      if (direntry.next == 0L)      /* EXIT on end of chain */
  792. X         break;                                 
  793. X      else
  794. X         entrycount++;              /* Number of directory entries */
  795. X        /* first direntry read, change dat_ofs from abs. pos. to rel. offset */
  796. X        if (first_dir && dat_ofs != 0) {
  797. X            dat_ofs -= direntry.offset;
  798. X            first_dir = 0;
  799. X        }
  800. X        direntry.next += dat_ofs;                /* allow for user-specified offset */
  801. X        if (direntry.comment != 0L)
  802. X            direntry.comment += dat_ofs;        /* so show_comment finds it */
  803. X   
  804. X      if (direntry.deleted)
  805. X         ++del_count;
  806. X
  807. X#ifdef TRACE_LIST
  808. X        if (trace_list)
  809. X            show_dir (&direntry);
  810. X#endif /* TRACE_LIST */
  811. X      
  812. X        /* Into `whichname' put the filename to display. Use long filename if 
  813. X        it exists, else use short filename.  */
  814. X            strcpy (whichname, fullpath (&direntry));
  815. X            if (zoo_header.vdata & VFL_ON)
  816. X                add_version (whichname, &direntry);    /* add version suffix */
  817. X#ifdef DEBUG
  818. X      printf("matching against [%s] and [%s]\n", 
  819. X               nameptr(whichname), whichname);
  820. X#endif
  821. X
  822. X      if ( ( (list_deleted && direntry.deleted) ||
  823. X               (list_deleted < 2 && !direntry.deleted)
  824. X           ) 
  825. X              && (biglist || needed(whichname, &direntry, &zoo_header))) {
  826. X            /* if generations forced off, then strip added version field */
  827. X            if (!genson) {    /* HORRENDOUSLY INEFFICIENT AND REPETITIOUS */
  828. X                char *ver_pos;
  829. X                ver_pos = findlast (whichname, VER_DISPLAY);
  830. X                if (ver_pos != NULL)
  831. X                    *ver_pos = '\0';
  832. X            }
  833. X   
  834. X         file_count++;
  835. X   
  836. X         if (direntry.packing_method > MAX_PACK) {
  837. X            bad_pack = 1;
  838. X            expl_ver = 1;
  839. X         }  else
  840. X            bad_pack = 0;
  841. X      
  842. X         size_factor = cfactor (direntry.org_size, direntry.size_now);
  843. X   
  844. X         year  =  ((unsigned int) direntry.date >> 9) & 0x7f;
  845. X         month =  ((unsigned int) direntry.date >> 5) & 0x0f;
  846. X         day   =  direntry.date        & 0x1f;
  847. X   
  848. X         hours =  ((unsigned int) direntry.time >> 11)& 0x1f;
  849. X         min   =  ((unsigned int) direntry.time >> 5) & 0x3f;
  850. X         sec   =  ((unsigned int) direntry.time & 0x1f) * 2;
  851. X   
  852. X            /* Alignment in columns is a horrendously complex undertaking. */
  853. X
  854. X         if (fast) {
  855. X                int space_left;
  856. X                int namelen;
  857. X                int next_col;
  858. X#if 0
  859. X            if ( (quiet && !first_ever || !first_time) && one_col)
  860. X               fputchar ('\n');
  861. X                first_ever = 0;
  862. X#endif
  863. X                /* If we are showing directories, whichname already contains the
  864. X                full pathname string.  Else we only use the filename as follows:
  865. X                long filename if possible, else short filename */
  866. X                if (!showdir) {
  867. X                   strcpy (whichname, 
  868. X                      (direntry.namlen != 0) ? direntry.lfname : direntry.fname);
  869. X                    if (genson && zoo_header.vdata & VFL_ON)
  870. X                        add_version (whichname, &direntry);    /* add version suffix */
  871. X                }
  872. X                namelen = strlen (whichname);
  873. X
  874. X#define MARGIN            78
  875. X#define COL_WIDTH        16
  876. X#if 1
  877. X                /* if not enough space left, move to next line */
  878. X                if (!one_col && column != 0) {
  879. X                    space_left = MARGIN - column;
  880. X                    if (namelen > space_left) {
  881. X                        neednl = 1;
  882. X                        column = 0;
  883. X                    }
  884. X                }
  885. X#endif
  886. X            if ( (quiet && !first_ever || !first_time) && (neednl || one_col))
  887. X                    printf ("\n");
  888. X                first_ever = 0;
  889. X                neednl = 0;
  890. X
  891. X            printf("%s", whichname);
  892. X                fflush (stdout);
  893. X                /* move to next column stop */
  894. X                column += namelen;
  895. X                next_col = ((column + (COL_WIDTH - 1)) / COL_WIDTH) * COL_WIDTH;
  896. X                if (next_col - column < 2)        /* need at least 2 spaces */
  897. X                    next_col += COL_WIDTH;
  898. X                if (next_col > MARGIN) {
  899. X                    neednl = 1;
  900. X                    column = 0;
  901. X                } else {
  902. X                    if (!one_col)
  903. X                        printf ("%*s", (next_col - column), " ");
  904. X                    column = next_col;
  905. X                }
  906. X   
  907. X         } else {
  908. X            if (talking && first_time && !show_name) {/*print archive header */
  909. X               printf ("Length    CF  Size Now  Date      Time\n");
  910. X               printf (tot_line);
  911. X            }
  912. X            printf ("%8lu %3u%% %8lu  %2d %-.3s %02d %02d:%02d:%02d",  
  913. X                     direntry.org_size, 
  914. X                     size_factor, direntry.size_now, 
  915. X                     day, &month_list[month*3], 
  916. X                     (day && month) ?  (year+80) % 100 : 0,
  917. X                     hours, min, sec);
  918. X               tot_org_siz += direntry.org_size;
  919. X               tot_siz_now += direntry.size_now;
  920. X#ifdef GETTZ
  921. X                printtz ((int) direntry.tz);    /* show timezone */
  922. X#else
  923. X                printf (" ");
  924. X#endif
  925. X
  926. X                if (show_crc)
  927. X                    printf ("%04x ", direntry.file_crc);
  928. X                if (show_gen) {
  929. X                    if (direntry.vflag & VFL_ON)
  930. X                        printf ("%2dg ", direntry.vflag & VFL_GEN);
  931. X                    else
  932. X                        printf ("--g ");
  933. X                }
  934. X   
  935. X            if (direntry.cmt_size) {
  936. X               expl_comment++;
  937. X               printf ("C");
  938. X            } else
  939. X               printf (" ");
  940. X   
  941. X            if (direntry.deleted) {
  942. X               expl_deleted++;
  943. X               printf ("D");
  944. X            }  else
  945. X               printf (" ");
  946. X            if (list_deleted)
  947. X               printf (" ");
  948. X            if (show_name)
  949. X               printf ("%-*s ", longest, this_zoo);
  950. X
  951. X#ifdef FATTR
  952. X                if (show_mode) {
  953. X                    if (direntry.fattr == 0)
  954. X                        printf ("--- ");
  955. X                    else if ((direntry.fattr >> 22) == 1)
  956. X                        printf ("%03o ", direntry.fattr & 0x1ff);
  957. X                    else
  958. X                        printf ("??? ");
  959. X                }
  960. X#endif /* FATTR */
  961. X
  962. X                /* new code to get around a common compiler bug */
  963. X                printf ("%s", whichname);
  964. X                if (direntry.dir_crc != 0) {
  965. X                    expl_star++;
  966. X                    printf ("*");
  967. X                }
  968. X
  969. X            if (bad_pack)
  970. X               printf (" (V%d.%d)", direntry.major_ver, direntry.minor_ver);
  971. X            printf ("\n");
  972. X         }
  973. X         first_time = 0;
  974. X   
  975. X         /* if verbose listing requested show any comment.  f overrrides v */
  976. X         if (verb_list && !fast)
  977. X            show_comment (&direntry, zoo_file, 0, (char *) NULL);
  978. X      } /* end if (lots of conditions) */
  979. X   
  980. X        /* ..seek to next dir entry */
  981. X      zooseek (zoo_file, direntry.next, 0);
  982. X   } /* end while */
  983. X   
  984. X   givesummary:
  985. X   
  986. X    if (fast && talking) {
  987. X       if (file_count) {
  988. X           if (del_count || (show_gen && zoo_header.type > 0))
  989. X              printf ("\n-----\n");
  990. X            else
  991. X              fputchar ('\n');
  992. X        }
  993. X        if (del_count)
  994. X            printf ("%d deleted.\n", del_count);
  995. X        if (show_gen && zoo_header.type > 0) {
  996. X            printf ("Generation limit %u",
  997. X                        zoo_header.vdata & VFL_GEN);
  998. X            if ((zoo_header.vdata & VFL_ON) == 0)
  999. X                printf (" (off).\n");
  1000. X            else
  1001. X                printf (".\n");
  1002. X        }
  1003. X    } /* end if (fast && talking) */
  1004. X
  1005. X   if (talking && !show_name) {
  1006. X      if (!fast && file_count) {
  1007. X         tot_sf = cfactor (tot_org_siz, tot_siz_now);
  1008. X         printf (tot_line);
  1009. X      
  1010. X         printf (tot_fmt, tot_org_siz, tot_sf, tot_siz_now, file_count);
  1011. X            if (file_count > 1)
  1012. X                printf ("s\n");
  1013. X            else
  1014. X                printf ("\n");
  1015. X         
  1016. X         if (del_count || expl_ver || expl_deleted || expl_comment ||
  1017. X                    expl_star || (show_gen && (zoo_header.type > 0)))
  1018. X            printf (dashes);
  1019. X      }
  1020. X   
  1021. X      if (!fast) {
  1022. X         if (del_count) {
  1023. X            if (expl_deleted)
  1024. X               printf ("D: deleted file.\n");
  1025. X            else {
  1026. X               if (del_count == 1)
  1027. X                  printf ("There is 1 deleted file.\n");
  1028. X               else
  1029. X                  printf ("There are %d deleted files.\n", del_count);
  1030. X            }
  1031. X         }
  1032. X      }
  1033. X      if (expl_comment && !fast && !verb_list) 
  1034. X         printf ("C: file has attached comment.\n");
  1035. X      if (expl_ver && !fast)
  1036. X         printf ("V: minimum version of Zoo needed to extract this file.\n");
  1037. X      if (expl_star && !fast)
  1038. X         printf ("*: directory entry may be corrupted.\n");
  1039. X      if (!file_count)
  1040. X         printf ("Zoo:  %s", no_match);
  1041. X      
  1042. X      if (!entrycount && !fiz_ofs)
  1043. X         printf ("(The archive is empty.)\n");
  1044. X        if (show_gen && (zoo_header.type > 0) && !fast) {
  1045. X            printf ("Archive generation limit is %u",
  1046. X                        zoo_header.vdata & VFL_GEN);
  1047. X            if ((zoo_header.vdata & VFL_ON) == 0)
  1048. X                printf (" (generations off).\n");
  1049. X            else
  1050. X                printf (".\n");
  1051. X        }
  1052. X   } /* end if (talking && !show_name) */
  1053. Xloop_end:            /* jump here on badly structured archive */
  1054. X   zooclose (zoo_file);
  1055. X} /* end for */
  1056. X
  1057. Xif (talking && show_name) {
  1058. X   if (file_count) {
  1059. X      tot_sf = cfactor (tot_org_siz, tot_siz_now);
  1060. X      printf (tot_line);
  1061. X      printf (tot_fmt, tot_org_siz, tot_sf, tot_siz_now, file_count);
  1062. X        if (file_count > 1)
  1063. X            printf ("s\n");
  1064. X        else
  1065. X            printf ("\n");
  1066. X   } 
  1067. X} else if (fast && quiet)
  1068. X    fputchar ('\n');
  1069. X    
  1070. X
  1071. Xif (!file_count)
  1072. X   zooexit (1);            /* Consider it an error if there were no files */
  1073. X} /* zoolist() */
  1074. X
  1075. X#ifdef GETTZ
  1076. Xvoid printtz (file_tz)
  1077. Xint file_tz;
  1078. X{
  1079. X    long gettz();
  1080. X    int diff_tz;                /* timezone difference */
  1081. X    if (file_tz == NO_TZ)     /* if no timezone stored ..*/
  1082. X        printf ("   ");            /* .. just pad with blanks */
  1083. X    else {
  1084. X        diff_tz = (file_tz / 4) - (int) (gettz() / 3600);
  1085. X        if (diff_tz == 0)
  1086. X            printf ("   ");                    /* print nothing if same */
  1087. X        else if (diff_tz > 0)            /* else print signed difference */
  1088. X            printf ("+%1d ", diff_tz);
  1089. X        else
  1090. X            printf ("-%1d ", -diff_tz);
  1091. X    }
  1092. X}
  1093. X#endif
  1094. X
  1095. X/*
  1096. XFOLLOWING CODE IS FOR DEBUGGING ONLY.  IT IS COMPILED IN ONLY
  1097. XIF THE SYMBOL TRACE_LIST IS DEFINED
  1098. X*/
  1099. X
  1100. X#ifdef TRACE_LIST
  1101. X/* code copied from portable.c near end */
  1102. X/* dump contents of directory entry */
  1103. Xvoid show_dir (direntry)
  1104. Xstruct direntry *direntry;
  1105. X{
  1106. X   printf ("Directory entry for file [%s][%s]:\n",
  1107. X            direntry->fname, direntry->lfname);
  1108. X   printf ("tag = [%8lx] type = [%d] PM = [%d] Next = [%8lx] Offset = [%8lx]\n",
  1109. X            direntry->zoo_tag, (int) direntry->type, 
  1110. X            (int) direntry->packing_method, direntry->next, 
  1111. X            direntry->offset);
  1112. X   printf ("Orig size = [%ld] Size now = [%ld] dmaj_v.dmin_v = [%d.%d]\n",
  1113. X         direntry->org_size, direntry->size_now,
  1114. X         (int) direntry->major_ver, (int) direntry->minor_ver);
  1115. X   printf ("Struc = [%d] DEL = [%d] comment_offset = [%8lx] cmt_size = [%d]\n",
  1116. X         (int) direntry->struc, (int) direntry->deleted, direntry->comment,
  1117. X         direntry->cmt_size);
  1118. X   printf ("var_dir_len = [%d] TZ = [%d] dir_crc = [%4x]\n",
  1119. X            direntry->var_dir_len, (int) direntry->tz, direntry->dir_crc);
  1120. X   printf ("system_id = [%d]  dirlen = [%d]  namlen = [%d] fattr=[%24lx]\n", 
  1121. X        direntry->system_id, direntry->dirlen, direntry->namlen, direntry->fattr);
  1122. X    printf ("vflag = [%4x] version_no = [%4x]\n",
  1123. X                direntry->vflag, direntry->version_no);
  1124. X   if (direntry->dirlen > 0)
  1125. X      printf ("dirname = [%s]\n", direntry->dirname);
  1126. X   printf ("---------\n");
  1127. X}
  1128. X#endif   /* TRACE_IO */
  1129. END_OF_FILE
  1130. if test 18889 -ne `wc -c <'zoolist.c'`; then
  1131.     echo shar: \"'zoolist.c'\" unpacked with wrong size!
  1132. fi
  1133. # end of 'zoolist.c'
  1134. fi
  1135. echo shar: End of archive 7 \(of 10\).
  1136. cp /dev/null ark7isdone
  1137. MISSING=""
  1138. for I in 1 2 3 4 5 6 7 8 9 10 ; do
  1139.     if test ! -f ark${I}isdone ; then
  1140.     MISSING="${MISSING} ${I}"
  1141.     fi
  1142. done
  1143. if test "${MISSING}" = "" ; then
  1144.     echo You have unpacked all 10 archives.
  1145.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1146. else
  1147.     echo You still need to unpack the following archives:
  1148.     echo "        " ${MISSING}
  1149. fi
  1150. ##  End of shell archive.
  1151. exit 0
  1152.